From: Zoltan Herczeg Date: Sun, 25 Jan 2026 05:38:11 +0000 (+0100) Subject: Backport of pcre2-10.48-Fix-scan-prefix-repeat-reset.patch X-Git-Tag: archive/raspbian/10.46-1_deb13u2+rpi1^2~8 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0b3560e67903e82df2a469b54b3245333d6e3485;p=pcre2.git Backport of pcre2-10.48-Fix-scan-prefix-repeat-reset.patch Cherry-pick of 7a33b226fe0dc243cbed47fcbe49025ec4aea125 Fix repeat reset for scan prefix (#875) (cherry picked from commit f945e356e0ba203a974717af2cff0baee01f1db4) --- diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c index 175eb68..90592c1 100644 --- a/src/pcre2_jit_compile.c +++ b/src/pcre2_jit_compile.c @@ -6107,6 +6107,7 @@ while (TRUE) repeat = GET2(cc, 1); if (repeat <= 0) { + repeat = 1; chars_end = chars; continue; } diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c index a7ade44..b336abe 100644 --- a/src/pcre2_jit_test.c +++ b/src/pcre2_jit_test.c @@ -277,6 +277,7 @@ static struct regression_test_case regression_test_cases[] = { { CM, A, 0, 0, "a1277|a1377|bx487", "bX487" }, { 0, A, 0, 0, "(a|)b*+a", "a" }, { 0, A, 0, 0 | F_NOMATCH, "(.|.|.|.|.)(|.|.|.|.)(.||.|.|.)(.|.||.|.)(.|.|.||.)(.|.|.|.|)(A|.|.|.|.)(.|A|.|.|.)(.|.|A|.|.)(.|.|.|A|.)(.|.|.|.|A)(B|.|.|.|.)(.|B|.|.|.)(.|.|B|.|.)(.|.|.|B|.)(.|.|.|.|B)xa", "1234567890123456ax" }, + { 0, A, 0, 0, "(CHAN|LINE)[ab]{0,2}", "LINE" }, /* Greedy and non-greedy ? operators. */ { MU, A, 0, 0, "(?:a)?a", "laab" },